﻿namespace H.Nets
{
    /// <summary>
    /// ITcpClient客户端之间进行通信时的TypeID,此处对一些框架已经使用的Type进行声明,理论上只要客户端和服务端数值统一即可,可自行定义
    /// </summary>
    public static class HFrameType
    {
        public const int UNKNOW = 0;

        /// <summary>
        /// 标识符类型(收到这种类型的数据,不会发射事件)
        /// </summary>
        public const int IDENTIFY = 0x10001;

        /// <summary>
        /// 设置接收缓冲区大小,报文内容一般是一个整数
        /// </summary>
        public const int RBUFFERSIZE = 0x10002;

        /// <summary>
        /// 成功
        /// </summary>
        public const int OK = 0x10200;

        /// <summary>
        /// 失败
        /// </summary>
        public const int FAIL = 0x10400;

        /// <summary>
        /// 需要执行其他指令
        /// </summary>
        public const int REDIRECT = 0x10301;

        /// <summary>
        /// 找不到指定图片
        /// </summary>
        public const int NOTFOUND = 0x10404;




        /// <summary>
        /// 日志类型
        /// </summary>
        public const int LOG = 0x20001;

        /// <summary>
        /// 二进制文件
        /// </summary>
        public const int BIN = 0x30001;

        /// <summary>
        /// 图像识别服务器相关消息类型ID
        /// </summary>
        public static class EyeServer
        {
            /// <summary>
            /// 加载图片消息
            /// </summary>
            public const int LOADPIC = 0x40001;

            /// <summary>
            /// 加载颜色消息
            /// </summary>
            public const int LOADCOLOR = 0x40002;


            /// <summary>
            /// 开始查找图片
            /// </summary>
            public const int SEEPIC = 0x41001;

        }

        public static class Runtime
        {
            /// <summary>
            /// 主动获取或被动接受当前正在运行的APP的信息,
            /// 消息体格式:1001,APPName1|1002,AppName2|...
            /// </summary>
            public const int RUNNING_APP = 0x50001;

            /// <summary>
            /// 运行一个APP(传递名称形式)
            /// 消息体格式:APP文件所在路径/文件名称|APP文件创建时间Ticks
            /// </summary>
            public const int EXECUTE_APPNAME = 0x50002;

            /// <summary>
            /// 运行一个APP(传递APP文件内容形式)
            /// 消息体格式:字符串长度+字符内容+APP内容长度+APP内容
            /// </summary>
            public const int EXECUTE_APPBYTES = 0x50003;

            /// <summary>
            /// 关闭一个APP,
            /// 消息体是一个int型整数
            /// </summary>
            public const int CLOSE_APP = 0x50004;

            /// <summary>
            /// 开启或关闭控制台,这可临时用于显示日志
            /// 消息体是一个boolean
            /// </summary>
            public const int CONSOLE_ENABLE = 0x50005;
        }

    }
}
